home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / include / RCS / rpc.h,v < prev    next >
Encoding:
Text File  |  1992-10-01  |  10.7 KB  |  392 lines

  1. head     1.8;
  2. branch   ;
  3. access   ;
  4. symbols  sprited:1.8.1;
  5. locks    jhh:1.8; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.8
  10. date     91.05.30.13.12.56;  author jhh;  state Exp;
  11. branches 1.8.1.1;
  12. next     1.7;
  13.  
  14. 1.7
  15. date     91.04.12.19.30.31;  author kupfer;  state Exp;
  16. branches ;
  17. next     1.6;
  18.  
  19. 1.6
  20. date     90.11.29.20.35.49;  author kupfer;  state Exp;
  21. branches ;
  22. next     1.5;
  23.  
  24. 1.5
  25. date     90.03.28.13.40.21;  author mgbaker;  state Exp;
  26. branches ;
  27. next     1.4;
  28.  
  29. 1.4
  30. date     90.03.26.12.12.48;  author mgbaker;  state Exp;
  31. branches ;
  32. next     1.3;
  33.  
  34. 1.3
  35. date     89.06.23.11.27.38;  author rab;  state Exp;
  36. branches ;
  37. next     1.2;
  38.  
  39. 1.2
  40. date     88.10.21.09.16.49;  author douglis;  state Exp;
  41. branches ;
  42. next     1.1;
  43.  
  44. 1.1
  45. date     88.10.21.09.13.55;  author douglis;  state Exp;
  46. branches ;
  47. next     ;
  48.  
  49. 1.8.1.1
  50. date     91.10.21.22.00.00;  author kupfer;  state Exp;
  51. branches ;
  52. next     ;
  53.  
  54.  
  55. desc
  56. @Definitions for user interface to Sprite kernel RPC.  This defines
  57. statistics structures and parameters for RPC echo testing
  58. @
  59.  
  60.  
  61. 1.8
  62. log
  63. @added include of sprite.h and spriteTime.h since this header needs
  64. some definitions from those files
  65. @
  66. text
  67. @/*
  68.  * rpc.h --
  69.  *
  70.  *    User declarations for dealing with the Sprite RPC system.
  71.  *
  72.  * Copyright (C) 1987 Regents of the University of California
  73.  * All rights reserved.
  74.  *
  75.  *
  76.  * $Header: /sprite/src/lib/include/RCS/rpc.h,v 1.7 91/04/12 19:30:31 kupfer Exp $ SPRITE (Berkeley)
  77.  */
  78.  
  79. #ifndef _RPCUSER
  80. #define _RPCUSER
  81.  
  82. #include <cfuncproto.h>
  83. #include <sprite.h>
  84. #include <spriteTime.h>
  85.  
  86. /* 
  87.  * All RPC names should fit in a char array this long (including the 
  88.  * trailing null byte).
  89.  */
  90. #define RPC_MAX_NAME_LENGTH    100
  91.  
  92.  
  93. /*
  94.  * The record counting various RPC client system events.
  95.  */
  96. typedef struct Rpc_CltStat {
  97.         /*
  98.          * Counters incremented during dispatch.
  99.          */
  100.     int toClient;    /* # of packets destined for client side RPC */
  101.     int badChannel;    /* # of packets discarded because of a bad channel */
  102.             /* (toClient - badChannel) msgs passed to dispatch */
  103.     int chanBusy;    /* # of times input was dropped because the channel
  104.              *     it was for was busy, ie. not waiting for input */
  105.     int badId;        /* # of packets discarded because of a bad (old) ID */
  106.         /*
  107.          * requests = replies + aborts
  108.          */
  109.     int requests;    /* # of request messages sent to the server */
  110.     int replies;    /* ... of replies from the server.  Not counting
  111.              *     on going RPCs, the total # of requests should
  112.              *     equal the sum of timeouts, tooManyAcks, errors
  113.              *     and replies. */
  114.     int acks;        /* # of acknowledgment received from the server */
  115.     int recvPartial;    /* # of partial acks received from the server */
  116.     int    nacks;        /* # of negative acknowledgements from the server */
  117.     int    reNacks;    /* # of nacks after first for requests */
  118.     int    maxNacks;    /* # of nacks after setting max backoff wait */
  119.         /*
  120.          * timeouts = resends + aborts + sentPartial
  121.          */
  122.     int timeouts;    /* # of timeouts waiting for a reply message */
  123.     int aborts;        /* # of times an RPC aborted because of timeouts */
  124.     int resends;    /* # of messages resent to the server */
  125.     int sentPartial;    /* # of partial acks sent to the server */
  126.  
  127.     int errors;        /* ... of errors received from the server, these
  128.              *     errors are reflections of errors during
  129.              *     execution of the RPC, or errors during dispatch
  130.              *     of the RPC on the server. */
  131.     int nullErrors;    /* ... of times return error code was null */
  132.     int dupFrag;    /* # of duplicate frags received */
  133.     int close;        /* # of close requests from the server */
  134.  
  135.     int oldInputs;    /* Same as badID, but when recieved by process */
  136.     int badInput;    /* # times received unexpected message type */
  137.     int tooManyAcks;    /* # of times a large number of acks were
  138.              * received while waiting for a reply. Could be
  139.              * incremented more than once per RPC */
  140.         /*
  141.          * These fields record events related to allocating channels 
  142.          */
  143.     int chanWaits;    /* ... of times a process had to wait for a channel. */
  144.     int chanBroads;    /* ... of times a broadcast was done to wake up
  145.              *     processes waiting for channels. */
  146.     int chanHits;    /* ... of times a channel was reallocated to the same
  147.              *     server. */
  148.     int chanNew;    /* ... indicates how many different channels have been
  149.              *     allocated.  The system tries to allocate a
  150.              *     different channel for different servers.*/
  151.     int chanReuse;    /* ... of times a channel had to allocated for a
  152.              *     server that was different from the one it had
  153.              *     been allocated to before. */
  154.     int    newTrouble;    /* ... of times a server not already ramped down
  155.                    is ramped down by client. */
  156.     int    moreTrouble;    /* ... of times a server already ramped down is again
  157.                    noted as sending nacks. */
  158.     int    endTrouble;    /* ... of times a server previously ramped down is
  159.                    marked as okay again. */
  160.     int    noMark;        /* ... of times there was no room to mark a server
  161.                    as in trouble - too many servers in trouble! */
  162.     int    nackChanWait;    /* ... of waits for busy channel 'cause ramped down. */
  163.         /*
  164.          * These are common to both client-side and server-side
  165.          */
  166.     int paramOverrun;    /* ... of times the parameters were too big */
  167.     int dataOverrun;    /* ... of times the data was too big */
  168.     int shorts;        /* ... of too short packets discarded by Rpc_Dispatch */
  169.     int longs;        /* ... of too long packets trimmed down, Rpc_Dispatch */
  170.  
  171. } Rpc_CltStat;
  172.  
  173. /*
  174.  * The record counting various RPC server system events.
  175.  * 
  176.  * Warning: the kernel routine RpcResetSrvStat relies on the fact that 
  177.  * the stats are an array of ints.
  178.  */
  179. typedef struct Rpc_SrvStat {
  180.     int toServer;    /* # messages to the server half of RPC */
  181.     int noAlloc;    /* # srvr msgs discarded due to no srvr proc avail */
  182.     int    nacks;        /* # neg acks sent */
  183.     int invClient;    /* # srvr msgs discarded from invalid clients */
  184.     int serverBusy;    /* # requests ignored because srvr proc was busy */
  185.             /* Messages passed to RpcServerDispatch is equal to
  186.              * toServer - noAlloc - invClient */
  187.     int requests;    /* # messages that start a new RPC */
  188.     int impAcks;    /* # requests that imp acked previous reply */
  189.     int handoffs;    /* # times complete message handed to srvr proc */
  190.     int fragMsgs;    /* # of packets that were the first fragment of msg */
  191.             /* requests = handoffs + fragMsgs - serverBusy */
  192.     int handoffAcks;    /* # acks sent when handoff occurred */
  193.     int fragAcks;    /* # acks sent when fragment received */
  194.     int sentPartial;    /* # of partial acknowledgments sent */
  195.     int busyAcks;    /* # acks sent when srvr proc was busy with request */
  196.  
  197.     int resends;    /* # of reply messages that were resent */
  198.     int badState;    /* # msgs ignored because srvr in unexpected state */
  199.     int extra;        /* # msgs ignored because srvr was SRV_FREE */
  200.     int reclaims;    /* # times a server process was forcibly reclaimed
  201.              *     from an unreachable client */
  202.     int reassembly;    /* # of packets that were reassembled */
  203.             /* Total number of fragments received is the sum of
  204.              * fragMsgs + dupFrag + reassembly */
  205.     int dupFrag;    /* # duplicate fragments received */
  206.     int nonFrag;    /* # nonFrag msgs ignored when srvr was SRV_FRAGMENT */
  207.     int fragAborts;    /* # requests that aborted previous frag assembly */
  208.  
  209.     int recvPartial;    /* # of partial acks received */
  210.     int closeAcks;    /* # acks that close a connection, RPC_CLOSE */
  211.     int discards;    /* # broadcasts discarded because of SRV_NO_REPLY */
  212.     int unknownAcks;    /* # of unexpected types of acks */
  213.     int mostNackBuffers;/* high-water mark of nack buffers used */
  214.     int selfNacks;    /* # of nacks we tried to send ourselves */
  215. } Rpc_SrvStat;
  216.  
  217.  
  218. /*
  219.  * Commands for the Test_Rpc system call.
  220.  *    This is invoked via
  221.  *        status = Test_Rpc(command, argPtr);
  222.  */
  223.  
  224. #define TEST_RPC_ECHO    1
  225. #define TEST_RPC_SEND    2
  226. #define TEST_RPC_BOUNCE    3
  227.  
  228. typedef struct Rpc_EchoArgs {
  229.     int serverID;        /* Sprite host ID of echo target */
  230.     int n;            /* Number of repetitions */
  231.     int size;            /* Size of packet, up to 16 K bytes */
  232.     Address inDataPtr;        /* Pointer to send buffer */
  233.     Address outDataPtr;        /* Pointer to receive buffer */
  234.     Time *deltaTimePtr;        /* Elapsed time of all n tests */
  235. } Rpc_EchoArgs;
  236.  
  237.  
  238. extern void Rpc_GetName _ARGS_ ((int rpcNum, int resultLen, char *resultPtr));
  239.  
  240. #endif /* _RPCUSER */
  241. @
  242.  
  243.  
  244. 1.8.1.1
  245. log
  246. @Initial branch for Sprite server.
  247. @
  248. text
  249. @d10 1
  250. a10 1
  251.  * $Header: /sprite/src/lib/include/RCS/rpc.h,v 1.8 91/05/30 13:12:56 jhh Exp $ SPRITE (Berkeley)
  252. @
  253.  
  254.  
  255. 1.7
  256. log
  257. @Add stuff for Rpc_GetName.
  258. @
  259. text
  260. @d10 1
  261. a10 1
  262.  * $Header: /sprite/src/lib/include/RCS/rpc.h,v 1.6 90/11/29 20:35:49 kupfer Exp Locker: kupfer $ SPRITE (Berkeley)
  263. d17 2
  264. @
  265.  
  266.  
  267. 1.6
  268. log
  269. @Add a warning about the structure of Rpc_SrvStat.  Fold in Mary's nack
  270. counters.
  271. @
  272. text
  273. @d4 1
  274. a4 2
  275.  *    Declarations for Test_Rpc system call and of the statistics returned
  276.  *    by the SYS_RPC_CLT_STATS and SYS_RPC_SRV_STATS commands to Sys_Stats.
  277. d10 1
  278. a10 1
  279.  * $Header: /sprite/src/lib/include/RCS/rpc.h,v 1.5 90/03/28 13:40:21 mgbaker Exp Locker: kupfer $ SPRITE (Berkeley)
  280. d16 9
  281. d168 3
  282. @
  283.  
  284.  
  285. 1.5
  286. log
  287. @Added more counters to client info.
  288.  
  289. @
  290. text
  291. @d11 1
  292. a11 1
  293.  * $Header: /sprite/src/lib/include/RCS/rpc.h,v 1.4 90/03/26 12:12:48 mgbaker Exp Locker: mgbaker $ SPRITE (Berkeley)
  294. d99 3
  295. d137 2
  296. a138 1
  297.  
  298. @
  299.  
  300.  
  301. 1.4
  302. log
  303. @Checkin before install of kernel.  Added rpc, etc, hooks to Sys_Stat
  304. @
  305. text
  306. @d11 1
  307. a11 1
  308.  * $Header: /sprite/src/lib/include/RCS/rpc.h,v 1.3 89/06/23 11:27:38 rab Exp Locker: mgbaker $ SPRITE (Berkeley)
  309. d41 2
  310. @
  311.  
  312.  
  313. 1.3
  314. log
  315. @*** empty log message ***
  316. @
  317. text
  318. @d11 1
  319. a11 1
  320.  * $Header: /sprite/src/lib/include/RCS/rpc.h,v 1.2 88/10/21 09:16:49 douglis Exp Locker: rab $ SPRITE (Berkeley)
  321. d40 1
  322. d76 9
  323. d101 1
  324. @
  325.  
  326.  
  327. 1.2
  328. log
  329. @Nuked stuff for RPCs using named pipes (which don't exist anymore)
  330. @
  331. text
  332. @d11 1
  333. a11 1
  334.  * $Header: /sprite/src/lib/include.new/RCS/rpc.h,v 1.1 88/10/21 09:13:55 douglis Exp Locker: douglis $ SPRITE (Berkeley)
  335. d144 1
  336. a144 1
  337. #endif _RPCUSER
  338. @
  339.  
  340.  
  341. 1.1
  342. log
  343. @Initial revision
  344. @
  345. text
  346. @d4 2
  347. a5 1
  348.  *    Declarations for user-level RPC's.
  349. d11 1
  350. a11 1
  351.  * $Header: rpc.h,v 2.1 87/08/24 09:31:16 brent Exp $ SPRITE (Berkeley)
  352. a142 38
  353.  
  354.  
  355. /*
  356.  * Define structures and constants for user-level RPCs using named pipes.
  357.  * This is old stuff and is super-ceeded by the pseudo-device interface.
  358.  */
  359.  
  360. /* Associate a connection ID and 3 streams with each client-server
  361.  * connection.  ResponseStream is for control information, while
  362.  * dataStream is where the data is actually written.
  363.  */
  364.  
  365. typedef struct {
  366.     int        connectionID;
  367.     int        requestStream;
  368.     int        responseStream;
  369.     int        dataStream;
  370.     char    *requestName;
  371.     char    *dataName;
  372. } RpcUser_Connection;
  373.  
  374. /*
  375.  * Each RPC contains a parameter specifying the type of call (interpreted
  376.  * by the server process that reads the command), plus the sizes of and
  377.  * pointers to input and output buffers.
  378.  */
  379.  
  380. typedef struct {
  381.     int     param;
  382.     int        dataSize;
  383.     int        replySize;
  384.     Address    dataPtr;
  385.     Address    replyPtr;
  386. } RpcUser_Storage;
  387.  
  388.  
  389.  
  390.  
  391. @
  392.